const http = uni.$u.http;

export const postMenu = (params, config = {}) =>
  http.post("/ebapi/public_api/index", params, config);

// get请求，获取菜单，注意：get请求的配置等，都在第二个参数中，详见前面解释
export const getHello = (data) => http.get("/hello", data);

export const getIndex = (data) => http.get("/api/index/index", data);
export const getVerifyIndex = () => http.post("/api/index/verifyIndex", {});
export const sysConfigs = (data) => http.post("/api/sysConfigs", data);
export const getIndexMore = (params, config = {}) =>
  http.post("/api/index/more", params, config);
export const getProductInfo = (id, data) =>
  http.post("/api/index/productInfo/" + id, data);
export const appLogin = (params, config = {}) =>
  http.post("/api/user/login", params, config);
export const getUserInfo = (data) =>
  http.get("/v2/user/info", { ...data, toast: false });
export const getUserAddress = (data) => http.get("/api/user/address", data);
export const saveUserAddress = (params, config) =>
  http.post("/api/user/saveAddress", params, config);
export const getBindCode = (params, config) =>
  http.post("/api/user/code", params, config);
export const userBindMobile = (params, config) =>
  http.post("/api/user/bindMobile", params, config);
export const nftCreateOrder = (params) =>
  http.post("/api/order/create", params, { custom: { auth: true } });
export const createOrder = (params) =>
  http.post("/api/order/create2", params, { custom: { auth: true } });
export const confirmOrder = (params) =>
  http.post("/api/order/confirm", params, { custom: { auth: true } });
export const getOrderPage = (params) =>
  http.post("/api/order/pages", params, {
    custom: { auth: true, toast: false },
  });
export const getOrderInfo = (params) =>
  http.get("/api/order/info", { params, custom: { auth: true } });
export const getNftPage = (params) =>
  http.post("/api/user/nft", params, { custom: { auth: true, toast: false } });
export const getNoticePage = (data) =>
  http.post("/v2/user/notice", data, { custom: { auth: true } });
export const getNftInfo = (id) =>
  http.get("/api/withdraw/nftInfo/" + id, { custom: { auth: true } });
export const getCsrfToken = () =>
  http.get("/api/withdraw/csrfToken", { custom: { auth: true } });
export const withdrawSubmit = (data) =>
  http.post("/api/withdraw/submit", data, { custom: { auth: true } });
export const getWithdrawPage = (data) =>
  http.post("/api/withdraw/pages", data, { custom: { auth: true } });
export const getWechatPay = (data) =>
  http.post("/api/pay/wechat", data, { custom: { auth: true } });
export const getPointLog = (data) =>
  http.post("/api/user/pointLogs", data, { custom: { auth: true } });
export const orderComplete = (id) =>
  http.post("/api/order/complete/" + id, {}, { custom: { auth: true } });
export const getCodeInfoData = (data) =>
  http.post("/api/verify/codeInfo", data);
export const receiveGift = (data) =>
  http.post("/api/verify/receive", data, { custom: { auth: true } });
export const userBindPhone = (data) =>
  http.post("/api/user/bindPhone", data, { custom: { auth: true } });
export const getCartList = (data) =>
  http.post("/api/cart/index", data, { custom: { auth: true, toast: false } });
export const setCartCalculate = (data) =>
  http.post("/api/cart/calculate", data, { custom: { auth: true } });
export const delCart = (data) =>
  http.post("/api/cart/del", data, { custom: { auth: true } });
export const getColumnProduct = (data) =>
  http.post("/api/index/columnProduct", data, { custom: { auth: true } });
export const nftGift = (data) =>
  http.post("/api/trade/gift", data, { custom: { auth: true } });
export const giftRecord = (data) =>
  http.post("/api/trade/record", data, { custom: { auth: true } });
export const addCart = (data) =>
  http.post("/api/cart/add", data, { custom: { auth: true } });
export const getHotKeywork = () => http.get("/api/index/hot");
export const getSearchProduct = (data) => http.post("/api/index/search", data);
export const getHelpList = () => http.get("/api/article/help");
export const getActivityNum = (data) =>
  http.post("/api/activity/num", data, { custom: { auth: true } });
export const getUserActivity = (data) =>
  http.post("/api/activity/user", data, { custom: { auth: true } });
export const getUserTicket = (data) =>
  http.post("/api/ticket/user", data, { custom: { auth: true, toast: false } });
export const getGrabOrderInfo = (id) =>
  http.get("/api/grabOrder/info/" + id, { custom: { auth: true } });
export const getActivityDetail = (data) =>
  http.post("/api/activity/detail", data, { custom: { auth: true } });
export const getUserTicketPage = (data) =>
  http.post("/v2/user/ticket", data, { custom: { auth: true, toast: true } });
export const getGrabOrderDetail = (data) =>
  http.post("/api/grabOrder/detail", data, {
    custom: { auth: true, toast: false },
  });
export const getOrderUnionPage = (data) =>
  http.post("/api/order/union", data, { custom: { auth: true } });
export const getActivityResult = (data) =>
  http.post("/api/activity/result", data, { custom: { auth: true } });
export const activitySubmitAddress = (data) =>
  http.post("/api/activity/submitAddress", data, { custom: { auth: true } });
export const getActivityPages = (data) =>
  http.post("/api/activity/pages", data, { custom: { auth: true } });
export const getArticleInfo = (data) => http.post("/api/article/info", data);
export const getWxConfig = (data) => http.post("/api/wxConfig", data);
export const getAgentTop = (data) => http.post("/api/agent/top", data);
export const getIndexV2Data = () => http.post("/v2/index/index");
export const getIndexProductData = (data) =>
  http.post("/v2/index/product", data);
export const getAggregateData = () => http.get("/v2/index/aggregate");
export const getUsedAggregateData = (data) =>
  http.post("/v2/index/usedAggregate", data);
export const getAggregateInfoData = (id) =>
  http.get("/v2/index/aggregateInfo/" + id);
export const getNftAggregateData = (data) =>
  http.post("/v2/index/nftAggregate", data);
//export const getAggregateInfoData = (id) => http.get("/v2/index/aggregateInfo/" + id)
export const getNftInfoData = (data) => http.post("/v2/index/nftInfo", data);
export const getGrabOrderCashierData = (id) =>
  http.get("/v2/grab_order/cashier/" + id, { custom: { auth: true } });
export const getGrabOrderConfirm = (data) =>
  http.post("/v2/grab_order/confirm", data, { custom: { auth: true } });
export const getredemptionorder = (data) =>
  http.post("/v2/order/pages", data, { custom: { auth: true } });
export const getGrabOrderPage = (data) =>
  http.post("/v2/grab_order/pages", data, { custom: { auth: true } });
export const getNftOwnerPage = (data) =>
  http.post("/v2/nft/owner", data, { custom: { auth: true } });
export const getCollectInfo = (data) =>
  http.post("/v2/nft/info", data, { custom: { auth: true } });

export const getUserPriority = (data) => http.post("/v2/user/priority", data,{ custom: { auth: true } })
export const getWalletData = (id, params = null) => http.get("/v2/wallet/info", { custom: { auth: true }, params })
export const getWalletLogPage = (data) => http.post("/v2/wallet/detail", data,{ custom: { auth: true } })
export const getboxofgoods = (params) =>http.get("/v2/blind_box/product", { params, custom: { auth: true } });
export const getIdentifyTop = (data) => http.post('/api/agent/identifyTop', data)
export const getUserRanking = (data) => http.post('/api/agent/userRanking', data, {custom: {auth: true, toast: false}})
export const getdownthelist = (data) => http.post('/v2/blind_box/detail', data, {custom: {auth: true, toast: false}})

export const getNoticeData = (data) => http.post('/v2/index/notice', data)

export const getNoticeInfo = (id) => http.get("/v2/index/noticeInfo/" + id)
export const getPaymentPages = (data) => http.post("/v2/payment/pages", data, {custom: {auth: true}})
export const getPlatformPaymentData = (data) => http.post("/v2/payment/platform", data, {custom: {auth: true}})
export const savePaymentData = (data) => http.post("/v2/payment/save", data, {custom: {auth: true}})
export const getPaymentInfo = (id) => http.get("/v2/payment/info/" + id, {custom: {auth: true}})
export const delPayment = (id) => http.post("/v2/payment/del/" + id, null,{custom: {auth: true}})
export const getPayChannel = () => http.get("/v2/index/paychannel")
export const getNftCollection = (data) => http.post("/v2/nft/collection", data, {custom: {auth: true}})
export const getExchangeMarket = (data) => http.post("/v2/exchange/market", data, {custom: {auth: true}})
export const getUserExchangeNum = () => http.get("/v2/exchange/num", {custom: {auth: true}})
export const getExchangeSeller = (data) => http.post("/v2/exchange/seller", data, {custom: {auth: true}})
export const getExchangeOrderInfo = (id) => http.get("/v2/exchange/info/" + id, {custom: {auth: true}})
export const getExchangeOrder = (data) => http.post("/v2/exchange/order", data, {custom: {auth: true}})
export const getUserPointLog = (data) => http.post("/v2/point/log", data, {custom: {auth: true}})
export const setUserNickname = (data) => http.post("/v2/user/nickname", data, {custom: {auth: true}})
export const boxConfirmAddress = (data) => http.post("/v2/blind_box/confirmAddress", data, {custom: {auth: true}})
export const userWithdrawPage = (data) => http.post('/v2/wallet/withdraw', data, {custom: {auth: true}})
export const noticeReal = () => http.post("/v2/user/ready", null, {custom: {auth: true}})
export const getShareInfo = () => http.get("/v2/user/share", {custom: {auth: true}})
